#ifndef KTCPCONNECTION_H
#define KTCPCONNECTION_H
#include "ctool.h"
#include <qjsonobject.h>
#include <QObject>
#include <QTcpSocket>
#include <qjsondocument.h>
class KTcpConnection : public QObject
{
    Q_OBJECT
public:
    explicit KTcpConnection(QObject *parent = nullptr);
    KTcpConnection(QObject *parent,QString ip,int port);

    void handleServerInfo(QByteArray byteArray);
    bool wirteToLogin(QByteArray acc,QByteArray psw,bool);
    int getPort() const;
    void setPort(int newPort);

    QString getIp() const;
    void setIp(const QString &newIp);

private:
    bool isToSaveToLocation=false;
    QByteArray dedicatedDelimiter="/codeNestktbocodeNest/";
    QTcpSocket *clientToServer;
    QString ip;
    int port;
    ctool *ctool;
signals:
};

#endif // KTCPCONNECTION_H
